<?php

/**
 * Description of PhotosSession 
 *
 * @author Pavel Homolka
 */
class PhotosSession extends Nette\Object {

    private $resultingPhotos;
    private $minLevenshteinDistance = NULL;
    private $minGreatCircleDistance = NULL;
    private $communication;

    public function __construct(\Nette\Http\Session $session) {
        $this->resultingPhotos = $session->getSection(__CLASS__);
        $this->communication = $session->getSection(__CLASS__ . 'communication');
    }

    public function add($photos) {
        $this->resultingPhotos[0] = $photos;
    }

    public function getResultingPhotos() {
        $photos = $this->resultingPhotos->getIterator()->getArrayCopy();
        return $photos[0];
    }

    public function clear() {
        $this->resultingPhotos->remove();
    }

    public function getMinLevenshteinDistance() {
        return $this->minLevenshteinDistance;
    }

    public function setMinLevenshteinDistance($minLevenshteinDistance) {
        $this->minLevenshteinDistance = $minLevenshteinDistance;
    }

    public function getMinGreatCircleDistance() {
        return $this->minGreatCircleDistance;
    }

    public function setMinGreatCircleDistance($minGreatCircleDistance) {
        $this->minGreatCircleDistance = $minGreatCircleDistance;
    }

    public function getCommunication() {
        return $this->communication->getIterator()->current();
    }

    public function setCommunication($communication) {
        $this->communication[] = $communication;
    }

}

?>
